function [StatTable]=SubFun_CollectResults(SOLUTION,Folder)


PP          =   SOLUTION.PP;
SS          =   SOLUTION.SS;

MODEL       =   SOLUTION.MODEL;
solution    =   SOLUTION.gxhx;
EquJac      =   SOLUTION.EquJac;
IRF         =   SOLUTION.IRF;

ShockList   =   {'Eps_Eta_M_dom','Eps_Eta_Y_H','Eps_Eta_M_ext',...
                 'Eps_Eta_Z','Eps_Eta_Z_H','Eps_Eta_Z_N'};

IRF_ConsDist    =   struct();
for ii_Irf=1:length(ShockList)
    SH                  =   ShockList{ii_Irf};
    IRF_ConsDist.(SH)   =   IRFAdd_ConsDist(PP,SS,MODEL,EquJac.HH_Aux,length(IRF.(SH).C),IRF.(SH));
end

RowNames    =   {'Inflation','Exchange Rate','Aggregate Consumption','Investment',...
                 'Dispersion',...
                 'By Real Integration',...
                 'By Financial Integration',...
                 'By Net Wealth'};
ColNames    =   ShockList;
StatData    =   zeros(length(RowNames),length(ShockList));
for ii=1:length(ShockList)
    SH          =   ShockList{ii};
    % Index for the Peak Consumption Response
    [~,MaxIdx]  =   max(abs(IRF.(SH).C));
    % Aggregate Consumption
    Temp_C      =   IRF.(SH).C(MaxIdx);
    Temp_C_Disp =   IRF_ConsDist.(SH).Disp(1,MaxIdx);
    % Investment
    if isfield(IRF.(SH),'KI')
        Temp_KI     =   IRF.(SH).KI(MaxIdx)+IRF.(SH).p_F(MaxIdx);
    else
        Temp_KI     =   NaN;
    end
    % Inflation and Exchange Rate
    Temp_Pir    =   IRF.(SH).Pir(MaxIdx);
    Temp_Irf_E  =   cumsum(IRF.(SH).dE);
    Temp_E      =   IRF.(SH).ExchangeRate(MaxIdx);
    % Consumption by FI
    Temp_C_dom  =   IRF.(SH).AggStat(1,MaxIdx);
    Temp_C_ext  =   IRF.(SH).AggStat(2,MaxIdx);
    % Consumption by RI
    Temp_C_N    =   IRF.(SH).AggStat(3,MaxIdx);
    Temp_C_H    =   IRF.(SH).AggStat(4,MaxIdx);
    % Consumption by NA
    Temp_C_poor =   IRF.(SH).AggStat(5,MaxIdx);
    Temp_C_rich =   IRF.(SH).AggStat(6,MaxIdx);
    
    StatData(:,ii) ...
                =   [Temp_Pir*100*4;Temp_E*100;Temp_C*100;Temp_KI*100;...
                     [Temp_C_Disp;(Temp_C_N-Temp_C_H);...
                      (Temp_C_dom-Temp_C_ext);(Temp_C_poor-Temp_C_rich)]/abs(Temp_C)...
                    ];
end

StatTable   =   array2table(StatData,'RowNames',RowNames,'VariableNames',ColNames);
if ~isempty(Folder)
    mkdir(Folder);
    writetable(StatTable,[Folder,'KeyResults.xlsx'],'WriteRowNames',true);
end